﻿namespace ImapComponent.Net.Mail.Mime
{
    using System.Collections;

    /// <summary>
    /// Represents a collection of EmailMessages.
    /// </summary>
    public class EmailMessageCollection : CollectionBase
    {
        #region Methods

        /// <summary>
        /// Adds the provided email message to the collection.
        /// </summary>
        /// <param name="emailMessage">The email message to be added.</param>
        public void Add(EmailMessage emailMessage)
        {
            this.List.Add(emailMessage);
        }

        #endregion // Methods

        #region Indexers

        /// <summary>
        /// Returns the email message at the specified index in the collection.
        /// </summary>
        public EmailMessage this[int index]
        {
            get
            {
                return (EmailMessage)this.List[index];
            }
        }

        #endregion // Indexers
    }
}